home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 98
/
Skunkware 98.iso
/
src
/
mail
/
pine3.96.tar.gz
/
pine3.96.tar
/
pine3.96
/
pine
/
osdep
/
mimedisp
< prev
next >
Wrap
Text File
|
1996-06-28
|
1KB
|
58 lines
/*----------------------------------------------------------------------
Can we display this type/subtype?
Args: type -- the MIME type to check
subtype -- the MIME subtype
params -- parameters
use_viewer -- tell caller he should run external viewer cmd to view
Result: returns 1 if the type is displayable, 0 otherwise.
Note: we always return 1 for type text and type message, but sometimes
we set use_viewer and sometimes we don't.
----*/
mime_can_display(type, subtype, params, use_viewer)
int type;
char *subtype;
PARAMETER *params;
int *use_viewer;
{
int rv;
/* give mailcap a crack at everything first */
if(mailcap_can_display(type, subtype, params)){
if(use_viewer)
*use_viewer = 1;
rv = 1;
}
else{
if(use_viewer)
*use_viewer = 0;
switch(type){
/* if mailcap didn't want to handle these, we will */
case TYPETEXT:
if(subtype && !strucmp(subtype, "HTML")){
rv = 0;
break;
}
case TYPEMESSAGE:
rv = 1;
break;
case TYPEAPPLICATION:
rv = (subtype && !strucmp(subtype, "DIRECTORY"));
break;
default:
rv = 0;
break;
}
}
return(rv);
}